package cn.rongdao.jrkabao.model.creditcard;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.bean.creditcard.ShortMessageBean;
import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/9/15
 */

public class ShortMessageModel extends BaseKaMaoModel {

    public static ShortMessageModel getInstance() {
        return getPresent(ShortMessageModel.class);
    }

    public void execute(String bankCode, String lastBankNumber, Observer<ShortMessageBean> observer) {
        addParamStrings("bank_code", FRString.valueOf(bankCode));
        addParamStrings("bankcard_no", FRString.valueOf(lastBankNumber));
        Observable<ShortMessageBean> observable = mServletApi.getShortMessageTemplate(mParams).map(new HttpFunction<ShortMessageBean>());

        toSubscribe(observable, observer);
    }
}